import { createApp } from 'vue'
import { createPinia } from 'pinia'
import './style.css'
import './styles/markdown.css'
import ElementPlus from 'element-plus'
import 'element-plus/dist/index.css'
import App from './App.vue'
import { useAppStore } from './stores/appStore'  // 确保路径正确

const app = createApp(App)
const pinia = createPinia()

app.use(pinia)
app.use(ElementPlus)

// 修改获取 store 的方式
const store = useAppStore()

console.log(`store ==> `, store)
try {
  await store.init()
  app.mount('#app')
} catch (error) {
  console.error('应用初始化失败:', error)
  // 显示错误信息给用户
}